#include <iostream>
#include <vector> 
using namespace std;

int divided(vector<int> &a,int low,int high){
    int p = a[low];
    while(low < high){
        while(low < high && p <= a[high])
            high--;
        a[low] = a[high];
        while(low < high && p >= a[low])
            low++;
        a[high] = a[low];
    }
    a[low] =p;
    return low;
}

void quickSort(vector<int> &a,int low,int high){
    if(low > high)return ;
    int povit = divided(a,low,high);
    quickSort(a, low,povit-1);
    quickSort(a, povit+1,high);
}